var gulp = require('gulp');
var rename = require('gulp-rename');
var clean = require('gulp-clean');
var del = require('del');

gulp.task('clean-build', function () {
    return del(['static/**']);
});

gulp.task('default', ['vendor'], function () {
    console.log('Task Done!')
});

gulp.task('index', ['clean'], function () {
    return gulp.src('build/index.html')
        .pipe(rename({
            basename: 'index',
            extname: '.ejs'
        }))
        .pipe(gulp.dest('server/src/views'));
});

gulp.task('vendor', ['index'], function () {
    return gulp.src(['build/**', '!build/index.html'])
        .pipe(gulp.dest('server/vendor/index'));
});

gulp.task('clean', function () {
    return del(['static/**']);
});
